package com.ruoyi.dispatch.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dispatch.mapper.TunnelInfoMapper;
import com.ruoyi.dispatch.domain.TunnelInfo;
import com.ruoyi.dispatch.service.ITunnelInfoService;

/**
 * 巷道信息Service业务层处理
 * 
 * @author wuxiaofang
 * @date 2025-04-08
 */
@Service
public class TunnelInfoServiceImpl implements ITunnelInfoService 
{
    @Autowired
    private TunnelInfoMapper tunnelInfoMapper;

    /**
     * 查询巷道信息
     * 
     * @param tunnelId 巷道信息主键
     * @return 巷道信息
     */
    @Override
    public TunnelInfo selectTunnelInfoByTunnelId(Long tunnelId)
    {
        return tunnelInfoMapper.selectTunnelInfoByTunnelId(tunnelId);
    }

    /**
     * 查询巷道信息列表
     * 
     * @param tunnelInfo 巷道信息
     * @return 巷道信息
     */
    @Override
    public List<TunnelInfo> selectTunnelInfoList(TunnelInfo tunnelInfo)
    {
        return tunnelInfoMapper.selectTunnelInfoList(tunnelInfo);
    }

    /**
     * 新增巷道信息
     * 
     * @param tunnelInfo 巷道信息
     * @return 结果
     */
    @Override
    public int insertTunnelInfo(TunnelInfo tunnelInfo)
    {
        tunnelInfo.setCreateTime(DateUtils.getNowDate());
        return tunnelInfoMapper.insertTunnelInfo(tunnelInfo);
    }

    /**
     * 修改巷道信息
     * 
     * @param tunnelInfo 巷道信息
     * @return 结果
     */
    @Override
    public int updateTunnelInfo(TunnelInfo tunnelInfo)
    {
        tunnelInfo.setUpdateTime(DateUtils.getNowDate());
        return tunnelInfoMapper.updateTunnelInfo(tunnelInfo);
    }

    /**
     * 批量删除巷道信息
     * 
     * @param tunnelIds 需要删除的巷道信息主键
     * @return 结果
     */
    @Override
    public int deleteTunnelInfoByTunnelIds(Long[] tunnelIds)
    {
        return tunnelInfoMapper.deleteTunnelInfoByTunnelIds(tunnelIds);
    }

    /**
     * 删除巷道信息信息
     * 
     * @param tunnelId 巷道信息主键
     * @return 结果
     */
    @Override
    public int deleteTunnelInfoByTunnelId(Long tunnelId)
    {
        return tunnelInfoMapper.deleteTunnelInfoByTunnelId(tunnelId);
    }
}
